package com.aos.eap.utils;

import android.view.View;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;

/**
 * @author hx
 * @date 2019/10/10
 * @desc
 */
public class AnimationUtils {
    public static void arrowAnimation(View view, int how) {
        if (how == 1) {
            Animation animation = new RotateAnimation(0f, 180f, Animation.RELATIVE_TO_SELF,
                    0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
            animation.setDuration(500);
            animation.setFillAfter(true);
            view.startAnimation(animation);
        } else {
            Animation animationDismiss = new RotateAnimation(180f, 0f, Animation.RELATIVE_TO_SELF,
                    0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
            animationDismiss.setDuration(500);
            animationDismiss.setFillAfter(true);
            view.startAnimation(animationDismiss);
        }
    }
}
